const express = require('express')
const router = require('./router')
const bodyParser = require('body-parser')
const session = require('express-session')
const app = express()

// post 插件
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())

//session 插件
app.use(session({
    secret: 'keyboard cat',
    resave: false,
    saveUninitialized: true
}))


app.use(router)

app.listen(3000, function() {
    console.log('启动服务')
})